package j02duotai;


class Animal1{
    //用处不大，，后面退化掉
    public void eat(){
        System.out.println("吃食物");
    }
}
class Cat1 extends Animal1{
    public void eat(){
        System.out.println("猫吃鱼");
    }
}
class Dog1 extends Animal1{
    public void eat(){
        System.out.println("狗吃骨头");
    }
}
public class J02duotaiarr {
    public static void main(String[] args) {
        Animal1[] aArr = new Animal1[2];
        aArr[0] = new Cat1();
        aArr[1] = new Dog1();

        aArr[0].eat();//猫吃鱼
        aArr[1].eat();//狗吃骨头
    }
}